<?php
require('includes/top.php');


$datacards = $_POST['datacards'];
$description = $_POST['description'];

$query = "SELECT * FROM data_card WHERE `datacard_name` = '".trim($datacards)."'";
$result = mysql_query($query);
if ( mysql_num_rows ( $result )> 0 )
{
    header("location: add_datacards.php?v=err");
}
else
 {
$sql1="INSERT INTO data_card(`datacard_name`,`description`) VALUES ('$datacards','$description')";
$result1=mysql_query($sql1);
}

if($result1>0)
{
header('Location: add_datacards.php?v=success');
}
else
{
header('Location: add_datacards.php?v=err');
}
?>